import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { lotblackVO, lotblackForm, lotblackQuery } from '@/api/access/parking-lot/parking-lot-black/types';

/**
 * 查询停车场 黑名单列表
 * @param query
 * @returns {*}
 */

export const listlotblack = (query?: lotblackQuery): AxiosPromise<lotblackVO[]> => {
  return request({
    url: '/parkinglot/lotBlack/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询停车场 黑名单详细
 * @param parkLotBlackId
 */
export const getlotblack = (parkLotBlackId: string | number): AxiosPromise<lotblackVO> => {
  return request({
    url: '/parkinglot/lotBlack/' + parkLotBlackId,
    method: 'get'
  });
};

/**
 * 新增停车场 黑名单
 * @param data
 */
export const addlotblack = (data: lotblackForm) => {
  return request({
    url: '/parkinglot/lotBlack',
    method: 'post',
    data: data
  });
};

/**
 * 修改停车场 黑名单
 * @param data
 */
export const updatelotblack = (data: lotblackForm) => {
  return request({
    url: '/parkinglot/lotBlack',
    method: 'put',
    data: data
  });
};

/**
 * 删除停车场 黑名单
 * @param parkLotBlackId
 */
export const dellotblack = (parkLotBlackId: string | number | Array<string | number>) => {
  return request({
    url: '/parkinglot/lotBlack/' + parkLotBlackId,
    method: 'delete'
  });
};
/**
 * 同步-停车场黑名单
 */
export const synchronization = (blackWhiteType: string | number): AxiosPromise<lotblackVO> => {
  return request({
    url: '/parkinglot/lotBlack/synchronization/' + blackWhiteType,
    method: 'get'
  });
};

